# coding: utf-8
from __future__ import (print_function, unicode_literals)

import sys
sys.path.append('..')

from Pinyin2Hanzi import DefaultHmmParams
from Pinyin2Hanzi import viterbi

hmmparams = DefaultHmmParams()

result = viterbi(hmm_params=hmmparams, observations=('si', 'chuan', 'cheng', 'du'), path_num = 5, log = True)
for item in result:
    print(item.score, '/'.join(item.path))

print(20*'--')

result = viterbi(hmm_params=hmmparams, observations=('s', 'c', 'c', 'd'), path_num = 2, log = True)
for item in result:
    print(item.score, '/'.join(item.path))

print(20*'--')